  <link rel="stylesheet" href="../Public/style/effect.css" />
   <!-- 共用头部1 -->
	 <div id="top">
		 <div class="head2 clear">
			 <div class="account sprite_icon">
				 <a href="javascript:history.go(-1)"><span class="icon1 icon_com"></span></a>
			 </div>
			   {if $title}
			    <div class="title">{$title}</div> 
               {else}
                <div class="title">{$seo_title}</div> 
               {/if}<div class="search sprite_icon">
			    <!-- <span class="icon2 icon_com">-->
			 </div>
		 </div>
	 </div> 
 <include file="Mobile:nav"/>             
 <div class="f_index">
		 <div class="swiper-container">
			 <div class="swiper-wrapper clear">
				 
				{php foreach($pics as $k=>$r):}
				 <div class="swiper-slide">
					 <a href="javascript:;">
						 <img src="{$r['filepath']}" alt="" class="content-slide" />
					 </a>
				 </div>
                 {php endforeach;}
			 </div>
		 </div>
		 <div class="pagination" style="display:none"></div>

		 <a href="javascript:;" class="back"></a>
		 <!--<a href="javascript:;" class="comment"></a>-->
	 </div>

	 <div class="content">
		 <div class="title border_bottom">
			 <h2>{$title|str_cut=###,20}</h2>
			 <p>{$r['describe']|str_cut=###,30}</p>
			 <div class="info clear">
				 <span class="icon1 icon_com"></span><strong> 
                     <YP:list name="Label" where="genre=17" id="v" limit="50">
                      <?php echo $itemType == $v['id'] ? $v['title'] : ''; ?>
                     </YP:list></strong><span class="icon2 icon_com"></span>
                 <strong>
                    <YP:list name="Label" where="genre=21" id="v" limit="50">
                       <?php echo $style == $v['id'] ? $v['title'] : ''; ?>
                    </YP:list>
                 </strong>
			 </div>
		 </div>


		 <div class="mes border_bottom">
			 <p><strong>设计理念：</strong>{$content}</p>
		 </div>

		 <div class="collection clear border_bottom">
			 <span class="icon3 icon_com"></span><em>{$hits}</em>
			 <a href="javascript:onclick=keep({$id})" ><strong>收藏：</strong><span class="icon4 icon_com"></span></a>
		 </div>

		 <div class="like_hate clear border_bottom">
			 <dl class="like">
				 <dt>
					 <a href="index.php?g=User&m=Index&a=eva_post&like=1&mm=Case&id={$id}"><img src="../Public/images/effect_pic2.jpg" alt="" /></a>
				 </dt>
				 <dd><a href="index.php?g=User&m=Index&a=eva_post&haet=1&mm=Case&id={$id}">{$like_num}</a></dd>
			 </dl>
			 <dl class="hate">
				 <dt>
					 <img src="../Public/images/effect_pic3.jpg" alt="" />
				 </dt>
				 <dd><a>{$haet_num}</a></dd>
			 </dl>
		 </div>
	     <form name="myform" id="myform" action="{:URL('User-Index/comment_post')}" method="post" onSubmit="return logina();">
        <input type="hidden" name="conid" value="{$id}"/> 
        <input type="hidden" name="contype" value="Case"/>
        <input type="hidden"  name="moduleid" value="{$moduleid}" />
        <input type="hidden"  name="catid" value="{$catid}" />
		<input type="hidden"  name="title" value="{$title}" /
		<input type="hidden"  name="lang" value="{$langid}" />
        <input type="hidden"  name="url" value="<?php echo $_SERVER['REQUEST_URI'];?>" />
		 <div class="padding_section clear border_bottom">
			 <div class="discuss clear">
				 <div class="pic">
					 <img src="../Public/images/effect_pic4.jpg" alt="" />
				 </div>
				 <textarea name="content" id="" cols="30" rows="10" placeholder="添加评论~~" class="discuss_box"></textarea>
                 
			 </div>
              <input type="submit" value="添加评论" style="font-family:微软雅黑"  class="add_discuss" />
			
		 </div>
		</form>  

         <ul class="comment_list">
           <?php 
         $field='jg_comment.id,jg_comment.content,jg_comment.createtime,jg_user.id as userid,jg_user.avatar,jg_user.username';
         $where='jg_Comment.`conid`='.$id.' and contype="Case"';
         $reluts=M('Comment')->field($field)->where($where)->join('jg_user ON jg_comment.userid = jg_user.id')->limit('50')->select();
          foreach($reluts as $key=>$val){
    ?>  
             <li class="clear">
                 <div class="pic">
                    <a href="index.php?g=Mobile&m=User&a=index&id={$val['userid']}"><img  src="{$val['avatar']}" alt="" /></a> 
                 </div>
                 <div class="info">
                     <strong><a href="index.php?g=Mobile&m=User&a=index&id={$val['userid']}">{$val['username']}</a></strong>
                     <span>{$val.createtime|toDate=###,'m-d H:i:s'}</span>
                     <em>说：</em>
                     <p class="mes">{$val['content']}</p>
                 </div>
             </li>
          <?php } ?> 
             
         </ul>
	 </div>
     
     
      <script type="text/javascript" src="../Public/js/idangerous.swiper-2.1.min.js"></script>      
 <script type="text/javascript">
		 var mySwiper = new Swiper('.swiper-container',{
			 pagination:'.pagination',
			 calculateHeight:true,
			 loop:true,
			 paginationClickable:true,
			 autoplay:3000,
			 autoplayDisableOnInteraction:false,
			 roundLengths:true,
			
			 onSlideChangeStart: function(swiper){ 
			        var H = $(".content-slide").eq(swiper.activeIndex).height();
					//alert(swiper.activeIndex)
						$(".swiper-slide").css('height', H + 'px');
						$(".swiper-wrapper").css('height', H + 'px');
			 
			   }
         })
	$(document).ready(function(){
		var H = $(".content-slide").eq(1).height();
					//alert(swiper.activeIndex)
			$(".swiper-slide").css('height', H + 'px');
			$(".swiper-wrapper").css('height', H + 'px');
		
		})	
		
     </script>
<script type="text/javascript">
function  keep(id){
	
	
		  var module='Case';
		  
		  var url=window.location.search;
		      url='index.php'+url;
		  var title=$(".title h2").html();
		 
      //alert(title);
		  //var userid=$("#keep_u").attr('name');
		 // alert(userid)
	
		  $.post(
				  'index.php?g=User&m=Index&a=keep', 
				  {'id':id,
				   'module':module,
				   'url':url,
				   'title':title,
				   'catid':2
				  },
				  function(res){
					 if(res.length>1000){
						 alert('您还未登录，请您先登录');
						 } else{
							 alert(res)
						      if(res=='收藏成功!'){
							  var keepnum=parseInt($(".keep_n").html())+1;
							  $(".keep_n").html(keepnum);
							  }
						 
						 }
					 
					});
	  
	}





</script>